<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>我订单列表</title>
		<link rel="stylesheet" href="<%=request.getContextPath()%>/resources/css/bootstrap.min.css" type="text/css" />
		<script src="<%=request.getContextPath()%>/resources/js/jquery-1.11.3.min.js" type="text/javascript"></script>
		<script src="<%=request.getContextPath()%>/resources/js/bootstrap.min.js" type="text/javascript"></script>
		<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery-heima-0.0.1.js" ></script>
	</head>

	<body>
		<div class="container-fluid"  style="max-width: 1370px;">
			<div id="header" style="min-height: 130px;"><jsp:include page="/header.jsp" /></div>
			<div class="container">
				<div class="row">
					<div style="margin:0 auto; margin-top:10px;width:950px;">
						<strong>我的订单</strong>
						<table class="table table-bordered">
							<tbody id="dindan">
							<c:forEach items="${pb.list}" var="i">
							<tr class="success">
								<th colspan="2">
									订单编号:
									<a href="<%=request.getContextPath()%>/orderServlet?method=getOneOrder&oid=${i.oid}">
											${i.oid}
									</a>
								</th>
								<c:if test="${i.state==0}">
								<th colspan="1">订单状态:<span>  未付款</span></th>
								</c:if>
								<c:if test="${i.state==1}">
								<th colspan="1">订单状态:<span>  已付款</span></th>
								</c:if>
								<c:if test="${i.state==2}">
								<th colspan="1">订单状态:<span>  已发货</span></th>
								</c:if>
								<c:if test="${i.state==3}">
								<th colspan="1">订单状态:<span>  已完成</span></th>
								</c:if>
								<th colspan="2">下单时间: ${i.ordertime} </th>
							</tr>
							<tr class="warning">
								<th>图片</th>
								<th>商品</th>
								<th>价格</th>
								<th>数量</th>
								<th>小计</th>
							</tr>

							<c:forEach items="${i.orderViewList}" var="a">
							<tr class="active">
								<td width="60">
									<input type="hidden" name="id" value="22">
									<img src="<%=request.getContextPath()%>/${a.pimage}" width="70" height="60">
								</td>
								<td width="30%">
									<a target="_blank" href="<%=request.getContextPath()%>/productServlet?method=getOneProduct&pid=${a.pid}">${a.pname}</a>
								</td>
								<td width="20%">
									￥${a.shop_price}
								</td>
								<td width="10%">
									${a.count}
								</td>
								<td width="15%">
									<span class="subtotal">￥${a.subTotal}</span>
								</td>
							</tr>
							</c:forEach>
							</c:forEach>

							</tbody>
						</table>
					</div>
				</div>
				<div style="text-align: center;">
					<ul class="pagination" id="pagination">
						<c:if test="${pb.currentPage>1}">
							<li><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=${pb.currentPage-1}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
						</c:if>
						<c:if test="${pb.currentPage<=1}">
							<li><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=1" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a></li>
						</c:if>

						<c:forEach begin="1" end="${pb.totalPage}" var="i" >
							<c:if test="${pb.currentPage==i}">
								<li class="active"><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=${i}">${i}</a></li>
							</c:if>
							<c:if test="${pb.currentPage!=i}">
								<li><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=${i}">${i}</a></li>
							</c:if>
						</c:forEach>

						<c:if test="${pb.currentPage<pb.totalPage}">
							<li><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=${pb.currentPage+1}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
						</c:if>
						<c:if test="${pb.currentPage>=pb.totalPage}">
							<li><a href="<%=request.getContextPath()%>/orderServlet?method=getAllOrder&pagenum=${pb.totalPage}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a></li>
						</c:if>
					</ul>
				</div>
			</div>
			<div id="footer"  style="min-height: 203px;"><jsp:include page="/foot.jsp" /></div>
		</div>
	</body>
</html>